<script setup lang="ts">
import { ref } from 'vue';


let isShow=ref(true)
isShow.value=false;
let onShow=()=>{   
    isShow.value=!isShow.value
}

</script>
<template>
<div>
<h1 v-if="isShow">我不好</h1>
<h1 v-else="isShow">你好不好</h1>
<div>
<button @click="onShow">显示</button>
<h2 v-show="isShow">你好</h2>
</div>
</div>
</template>
<style scoped></style>